import { useLocation } from 'react-router-dom';
import CommonList from './CommonList';
import { getOrderList } from './services';
import { useURLQuery } from '@/pages/OrderModule/common/hooks/useURLQuery'

const OrderList = (props) => {
  const {} = props;
  const defaultParams = {}

  const location = useLocation()
  const { query } = useURLQuery()
  const orderSn = query.orderSn || location.state?.orderSn || ''
  if (orderSn) {
    defaultParams.snArr = orderSn.split(',')
  }

  return (
      <CommonList defaultParams={defaultParams} actions="sysOrder" ajaxFn={getOrderList} />
  );
};

export default OrderList;
